import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.util.Vector;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;

public class EingabeMatrizen_Gui extends javax.swing.JDialog {

	private JPanel pane_west;
	private JPanel pane_center;
	private JPanel pane_east;

	JTextField[][] fieldListMatA;
	JTextField[][] fieldListMatB;

	GridLayout lay_gridMatA;
	GridLayout lay_gridMatB;

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				EingabeMatrizen_Gui inst = new EingabeMatrizen_Gui( 11,
						11, 11, 11);
				inst.setVisible(true);
			}
		});
	}

	public EingabeMatrizen_Gui( int xa, int ya, int xb, int yb) {
		super(null,Dialog.ModalityType.TOOLKIT_MODAL);
		initGUI(xa, ya, xb, yb);
	}

	private void initGUI(int xa, int ya, int xb, int yb) {
		try {

			pane_west = new JPanel();
			pane_center = new JPanel();
			pane_east = new JPanel();
			this.getContentPane().setLayout(new FlowLayout());
			this.getContentPane().add(pane_west, BorderLayout.WEST);
			this.getContentPane().add(pane_center, BorderLayout.CENTER);
			this.getContentPane().add(pane_east, BorderLayout.EAST);

			{
				lay_gridMatA = new GridLayout(xa, ya);
				pane_west.setLayout(lay_gridMatA);

				fieldListMatA = new JTextField[xa][ya];
				for (int i = 0; i < ya; i++) {
					for (int j = 0; j < xa; j++) {
						
						fieldListMatA[i][j] = new JTextField();
						pane_west.add(fieldListMatA[i][j]);
						fieldListMatA[i][j].setPreferredSize(new Dimension(15, 1));
						
					}
					

				}

			}

			{
				pane_center.setLayout(new BorderLayout());
				pane_center.setBorder((BorderFactory.createEmptyBorder(0, 5, 0, 5)));
				pane_center.add(new JSeparator(SwingConstants.VERTICAL),
						BorderLayout.CENTER);

			}

			{
				lay_gridMatB = new GridLayout(xb, yb);
				pane_east.setLayout(lay_gridMatB);

				fieldListMatB = new JTextField[xb][yb];
				for (int i = 0; i < yb; i++) {
					for (int j = 0; j < xb; j++) {
						
						fieldListMatB[i][j] = new JTextField();
						pane_east.add(fieldListMatB[i][j]);
						fieldListMatB[i][j].setPreferredSize(new Dimension(15, 1));
						
					}
					

				}

			

			}

			setSize(400, 300);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
